﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace TempEmployees.BLL.Database
{
    [Serializable]
    public class Filters : Dictionary<string, object>
    {
        public Filters() 
            : base() 
        { 
        }

        public Filters(Filters filters) 
            : base((Dictionary<string, object>)filters) 
        { 
        }

        protected Filters(SerializationInfo info, StreamingContext context) : base(info, context)
        { 
        }

        public struct Filter
        {
            public string key;
            public object value;
        }

        public static Filters FiltersBuilder(params Filter[] filters)
        {
            Filters output = new Filters();
            foreach (Filter filter in filters)
            {
                output.Add(filter.key, filter.value);
            }
            return output;
        }
    }
}
